package com.woniuxy.uumsweb.controller;

import com.woniuxy.uumsweb.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HomeController {
    @Autowired
    private LoginService loginService;

    @RequestMapping("/")
    public String index(){
        return "index"; //index页面
    }

    @RequestMapping("/login")
    public String login(){
        return "login"; //index页面
    }

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    @PostMapping("/uums/login")
    public String login(String username,String password){
        return loginService.login(username,password); //index页面
    }

}
